﻿// Program.cs
// This program contains the main class and main method of the simulator

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace armsim
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {

            var options = new Options();

            // parsing object for the command line arguments
            var parser = new CommandLine.CommandLineParser();

            // parses the command line arguments, and partially determines if they are valid
            var parseSuccess = parser.ParseArguments(args, options);


            if (options.TestFlag)
            {
                RAMTests.RunTests();
                CPUTests.RunTests();
                ComputerTests.RunTests();
                DecodeInstructionTest.RunTests();
                //return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(options));
            /*
            if (options.InputFile != null && options.MemorySize != 32768)
            {
                Application.Run(new Form1(options.InputFile, options.MemorySize));
                
            }
            else if (options.InputFile != null && options.MemorySize == 32768)
            {
                Application.Run(new Form1(options.InputFile));
            }
            else if (options.InputFile == null && options.MemorySize != 32768)
            {
                Application.Run(new Form1(options.MemorySize));
            }
            else
            {
                Application.Run(new Form1());
            }
             */
        }
    }
}
